package com.sanjiahantang.youjiarole.module.me.contract.models.impl;

import android.content.Context;

import com.sanjiahantang.youjiarole.base.BaseBean;
import com.sanjiahantang.youjiarole.base.CallBack;
import com.sanjiahantang.youjiarole.config.ConfigValue;
import com.sanjiahantang.youjiarole.http.BaseDelegate;
import com.sanjiahantang.youjiarole.http.OkHttpClientManager;
import com.sanjiahantang.youjiarole.module.me.contract.beans.ContractBean;
import com.sanjiahantang.youjiarole.module.me.contract.models.IContractModel;
import com.sanjiahantang.youjiarole.module.me.require.beans.RequireListBean;
import com.squareup.okhttp.Request;

import java.util.Map;

/**
 * Created by zy on 2017/9/8.
 */

public class ContractModel implements IContractModel {
    @Override
    public void loadContractList(final Context context, final Map<String,String> param, final CallBack<ContractBean> callBack) {
        OkHttpClientManager.postAsyn(context, ConfigValue.API_URL + "/project/contract/phone/searchProjectContractForRole", param,
                new BaseDelegate.ResultCallback<ContractBean>() {
                    @Override
                    public void onError(Request request, Object tag, Exception e) {
                        callBack.onFailure(e.getMessage());
                    }

                    @Override
                    public void onResponse(ContractBean response, Object tag) {
                        callBack.onSuccess(response,context,tag);
                    }
                });
    }

    @Override
    public void saveContractForPhoneDesign(Context context, Map<String, String> param, CallBack<BaseBean> callBack) {

    }

    @Override
    public void findUserRequireByIdPhone(Context context, Map<String, String> param, CallBack<RequireListBean> callBack) {

    }

    @Override
    public void indexContractInfo(Context context, Map<String, String> param, CallBack<BaseBean> callBack) {

    }
}
